package com.riteny.util.exception.handler;

import com.riteny.util.exception.ExceptionHandlerAgent;
import com.riteny.util.exception.entity.CommonException;
import com.riteny.util.exception.entity.RestResponseTemplate;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author Riteny
 * <p>
 * Update by Riteny 2021/12/1
 * 允許用戶在捕獲到異常<E>的
 * 之前{@link CustomExceptionHandler#beforceHandler(HttpServletRequest, HttpServletResponse, CommonException)}
 * 或者之後{@link CustomExceptionHandler#afterHandler(HttpServletRequest, HttpServletResponse, RestResponseTemplate, CommonException)}
 * 進行自定義操作
 * 2021/9/13  11:36
 */
public abstract class AbstractCustomExceptionHandler<E extends CommonException> implements CustomExceptionHandler<E> {

    /**
     * 將自身添加到異常處理代理類中
     */
    public AbstractCustomExceptionHandler() {
        ExceptionHandlerAgent.addHandler(this);
    }

}
